import { Controller, Get, Post, ParseUUIDPipe, Body, ParseEnumPipe, Req, Param, Delete, UseGuards } from '@nestjs/common';
import { ArticleLikeService } from './article-like.service'
import {AuthGuard} from '../../guard/auth.guard'
@Controller('article/like')
export class ArticleLikeController {
    constructor(
        private readonly articleLikeService: ArticleLikeService
    ) { }

    @Post(':id')
    @UseGuards(AuthGuard)
    postArticleLike(@Req() req, @Param('id', ParseUUIDPipe) article_id: string, ) {
        return this.articleLikeService.create(req.userId, article_id)
    }

    @Delete(':id')
    @UseGuards(AuthGuard)
    deleteArticleLike(@Req() req, @Param('id', ParseUUIDPipe) article_id: string, ) {
        return this.articleLikeService.delete(req.userId, article_id)
    }

}
